function deepClone(origin,hashMap = new WeakMap()){
    if( !origin || typeof origin !=='object'){
        return origin;
    }
    if(origin instanceof Date){
        return new Date(origin);
    }
    if(origin instanceof RegExp){
        return new RegExp(origin);
    }
    const value = hashMap.get(origin);
    if(value){
        return value;
    }
     const target = new origin.constructor();
     hashMap.set(origin,target);
    for(let key in origin){
       target[key] = deepClone(origin[key],hashMap);
    }
    return target;
}

//  test----------------

const o1={},o2={};
    o1.o2=o2;
    o2.o1=o1;
    console.log(deepClone(o1),o1);
    o2.aa = '123';
export default deepClone;